#ifndef SETTINGS_H
#define SETTINGS_H

#include <QObject>
#include <QStringList>


class Settings : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString projectPath READ projectPath WRITE setProjectPath)
    Q_PROPERTY(QStringList serversList READ serversList WRITE setServersList)

public:
    ~Settings();
    static Settings* instance();

    QString projectPath() { return m_projectPath; }
    void setProjectPath(const QString &path) { m_projectPath = path; }

    QStringList serversList() { return m_serversList; }
    void setServersList(const QStringList &servers) { m_serversList = servers; }
    int serversCount() { return m_serversList.count(); }
    QString serverHost(int index);
    int serverPort(int index);

    void load();
    void save();

private:
    Settings();

    QString m_projectPath;
    QStringList m_serversList;

    static Settings *m_instance;
};

#endif // SETTINGS_H
